//
//  QZGoodsModel.m
//  map
//
//  Created by 000 on 16/8/23.
//  Copyright © 2016年 faner. All rights reserved.
//

#import "QZGoodsModel.h"

@implementation QZGoodsModel

- (instancetype)initWithDictionary:(NSDictionary *)dict
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+ (instancetype)goodsWithDictionary:(NSDictionary *)dict
{
    return [[QZGoodsModel alloc] initWithDictionary:dict];
}

+ (NSArray *)goodsModels
{
    NSArray *array = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"goods" ofType:@"plist"]];
    NSMutableArray *mArray = [NSMutableArray array];
    for (NSDictionary *dict in array) {
        QZGoodsModel *goodsModel = [QZGoodsModel goodsWithDictionary:dict];
        [mArray addObject:goodsModel];
    }
    return mArray;
}

@end
